/*
 * @file    backtrace.cpp
 * @author  Luo ZhiHui <camel.flying@gmail.com>
 * @version 1.0
 *
 * @section LICENSE
 *
 *
 * @section DESCRIPTION
 * test type_info class
 *
 */

#include <iostream>
#include <string>

int main(int argc, char **argv)
{


    return 0;
}

#include "stack_trace.h"
#include <stdio.h>

void TT2()
{
    int i, ret;
    long pRetAddr[100];
    char stackInfo[1024];
    int iStacks = backtrace(pRetAddr, 100);
    if(iStacks <= 0)
    {
 	printf("Error:No stacks information found!\n");
	return;
    }
    for(i = 0; i < iStacks; i++)
    {
 	ret = backtrace_symbols(pRetAddr[i], stackInfo, 1024);
	if(ret == 0)
  	    printf("%s\n", stackInfo);
	else
	    printf("Error.\n");
    }
}

void TT1()
{
    TT2();
}


int main(int argc, char *argv[])
{
    printf("Exe:%s.\n", argv[0]);

    init_symbols("/haoqf/src/Leak/Test64/test.out");
    //DumpMapFuncs(1);
    //DumpVectorFuncs(1);
    TT1();
    printf("Called TT1.\n");
    return 0;
}